<?php
require_once(dirname(__FILE__)."/../config/session.php");
require_once(dirname(__FILE__)."/../config/config.inc.php");
require_once(dirname(__FILE__)."/../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../libs/dbclass/dbconn.php");
require_once(dirname(__FILE__)."/../libs/dbclass/dbservice.php");
require_once(dirname(__FILE__)."/../libs/login/login.php");
$mc=new libstr();
$db=new dbconn();
$dbs=new dbservice();
$lp=new login();
if($mc->Ismp($_POST["postdata"])!="")
{

if($mc->Ismp($_SESSION["se".$_POST["id"]])=="")
{
$_SESSION["se".$_POST["id"]]="0";
$db->cmd("update product_content set penfen=penfen+".$_POST["num"].",penci=penci+1 where id=".$_POST["id"]."");
echo "ok";
exit();
}
echo "no";
exit();
}

if($mc->Ismp($_POST["messagepost"])!="")
{
if($mc->request("username","")==""){$mc->msg("姓名不能为空","go");}
if($mc->request("rootid","")==""){$mc->msg("留言类型不能为空","go");}

if($mc->request("tel","")==""){$mc->msg("电话不能为空","go");}
if($mc->request("fromwhere","")==""){$mc->msg("电子邮箱不能为空","go");}

if($mc->request("address","")==""){$mc->msg("地址不能为空","go");}
if($mc->request("content","")==""){$mc->msg("留言内容不能为空","go");}


$_username=$mc->request("username","");
$_rootid=$mc->request("rootid","");
$_sex=$mc->request("sex","");
$_nianling=$mc->request("nianling","0");
$_tel=$mc->request("tel","");
$_fromwhere=$mc->request("fromwhere","");
$_diqu=$mc->request("diqu","");
$_address=$mc->request("address","");
$_content=$mc->request("content","");
$_zt=$mc->request("zt","0");
$_ips=$mc->getip();
$_yuyuetime=$mc->request("yuyuetime",date("Y-m-d H:i:s"));
$_yisheng=$mc->request("yisheng","");
$_teltime=$mc->request("teltime",date("Y-m-d H:i:s"));
$_createtime=$mc->request("createtime",date("Y-m-d H:i:s"));

$db->cmd("insert into netmeet_content(username,rootid,sex,nianling,tel,fromwhere,diqu,address,content,zt,ips,yuyuetime,yisheng,teltime,createtime)values('".$_username."','".$_rootid."','".$_sex."',".$_nianling.",'".$_tel."','".$_fromwhere."','".$_diqu."','".$_address."','".$_content."',".$_zt.",'".$_ips."','".$_yuyuetime."','".$_yisheng."','".$_teltime."','".$_createtime."')");
$mc->msg("您的留言已经提交成功，我们会尽快处理您的信息，谢谢您对我们的支持！",$_POST["gourl"]);
}
?>